import React from 'react';
import {connect} from './mini-react-redux'
import { add_num,remove_num,waitAdd,addTwice } from './counter.redux'

class App extends React.Component {
  render() {
    return (
      <div>
        当前数量：{this.props.count}
        <br/>
        <button onClick={this.props.add_num}>加一</button>
        <button onClick={this.props.remove_num}>减一</button>
        <button onClick={this.props.waitAdd}>异步加一</button>
        <button onClick={this.props.addTwice}>数组同时两次加一</button>
      </div>
    );
  }
}

export default connect(
  state => state,
  { add_num,remove_num,waitAdd,addTwice }
)(App);
